package org.dbutily.service.impl;

import java.util.List;
import java.util.Map;

import org.dbutily.dao.DbMapper;
import org.dbutily.service.DbService;
import org.dbutily.tabledefine.Table;
import org.dbutily.tabledefine.TableColumn;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Transactional
@Service
public class DbServiceImpl implements DbService {

	@Autowired
	private DbMapper dbMapper;

	@Override
	public List<Table> findTablesBySchema(String schema) {
		return dbMapper.findTablesBySchema(schema);
	}
	@Override
	public List<TableColumn> findColumnsBySchemaAndTable(String tablename,String schema ) {
		return dbMapper.findColumnsBySchemaAndTable(tablename, schema);
	}
	@Override
	public List<Table> findAllTableInfoBySchema(String schema) {
		return dbMapper.findAllTablesInfoBySchema(schema);
	}
	@Override
	public Map<String, Object> showCreateTable(String tableName, String schema) {
		return dbMapper.showCeateTable(tableName);
	}
}
